package Tools;

public class Cylinder extends StereoscopicGraph {
	private double r;
	private double h;
	private double PI=3.14;
	private double area;
	private double volume;
	public Cylinder(){
		
	}
	public Cylinder(String name, double r,double h){
		super(name);
		this.r = r;
		this.h = h;
	}
	public double getR() {
		return r;
	}
	public void setR(double r) {
		this.r = r;
	}
	public double getH() {
		return h;
	}
	public void setH(double h) {
		this.h = h;
	}
	public void setArea(double area) {
		this.area = area;
	}
	public void setVolume(double volume) {
		this.volume = volume;
	}
	
	public double Area(){
	area=r*r*PI+r*r*PI+2*r*PI*h;
	String a = String.format("%.2f",area);
	double area = Double.parseDouble(a);
	return area;	
	}
	public double Volume(){
	volume=PI*r*r*h;
	String v = String.format("%.2f",volume);
	double volume = Double.parseDouble(v);
	return volume;
	}


}
